package com.itheima.controller;

import com.itheima.dto.Result;
import com.itheima.service.CheckitemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/checkitem")
public class CheckitemController {

    @Autowired
    private CheckitemService checkitemServiceImpl;

    @DeleteMapping(value = "/{id}")
    public Result delete(@PathVariable Integer id) {
        return checkitemServiceImpl.saveDelete(id)?
                Result.success("删除检查项成功"):
                Result.error("当前检查项已经被关联到检查组，不允许删除");
    }
}
